package org.example.day20240813;

import java.util.Arrays;

public class test3 {
    public static void main(String[] args) {
        String info = "10 20 30 40 50 60 70";
        String[] arr = info.split(" ");//以空格分割字符串，返回字符串类型数组
        System.out.println(Arrays.toString(arr));
        int result = 0;
        for(int i=0; i<arr.length; i++){
            result += Integer.parseInt(arr[i]);
        }
        System.out.println(result);
    }
}
